Adding some more judges, here and there.
[and.git] / lib / Mi manual de algoritmos / version_maraton_suramericana_2008 / src / c++ / fgetws.cpp
blob6283894d5bb08fc93a6c3690d53c506ab588d71b
1 #include <iostream>
2 #include <cassert>
3 #include <stdio.h>
4 #include <assert.h>
5 #include <wchar.h>
6 #include <wctype.h>
7 #include <locale.h>
10 using namespace std;
12 int main(){
13 assert(setlocale(LC_ALL, "en_US.UTF-8") != NULL);
14 wchar_t in_buf[512], out_buf[512];
15 swprintf(out_buf, 512, L"¿Podrías escribir un número?, Por ejemplo %d. ¡Gracias, pingüino español!\n", 3);
16 fputws(out_buf, stdout);
18 fgetws(in_buf, 512, stdin);
19 int n;
20 swscanf(in_buf, L"%d", &n);
22 swprintf(out_buf, 512, L"Escribiste %d, yo escribo ¿ÔÏàÚÑ~\n", n);
23 fputws(out_buf, stdout);
25 return 0;